﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsFormsApp3
{
    public class Class1
    {
      private static readonly  string cxlString = "server=.;database=Schools;uid=sa;pwd=1632174115";
        public static DataTable GetDataTable(string sql)
        {
            
            SqlConnection connection = new SqlConnection(cxlString);
            
            SqlDataAdapter adapter = new SqlDataAdapter(sql, connection);
            
            connection.Open();
            
            DataTable dt = new DataTable();

            adapter.Fill(dt);

            return dt;
        }
        public static int cxxx(string sql)
        {
            SqlConnection connection = new SqlConnection(cxlString);
            
            SqlCommand command = new SqlCommand(sql, connection);
            
            connection.Open();

            return command.ExecuteNonQuery();

        }
    }
}
